package com.study.gateway.controller;

import com.study.gateway.service.GatewayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: BacHe
 * @email: 1218585258@qq.com
 * @Date: 2020/9/24 1:04
 */
@RestController
public class GatewayController {
    @Value("${server.port}")
    private String serverPort;
    @Autowired
    private GatewayService gatewayService;

    //http://127.0.0.1/syncGatewayConfig
    @RequestMapping("/syncGatewayConfig")
    public String syncGatewayConfig() {
        return gatewayService.loadRoute();
    }
    @RequestMapping("/getServerPort")
    public String getServerPort(){
        return "当前网关的端口号是：" + serverPort;
    }
}
